package com.ruoyi.withdraw.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.withdraw.mapper.WithdrawApplyMapper;
import com.ruoyi.withdraw.domain.WithdrawApply;
import com.ruoyi.withdraw.service.IWithdrawApplyService;

/**
 * 门店提现申请记录Service业务层处理
 *
 * @author ruoyi
 * @date 2021-11-30
 */
@Service
public class WithdrawApplyServiceImpl implements IWithdrawApplyService
{
    @Autowired
    private WithdrawApplyMapper withdrawApplyMapper;

    /**
     * 查询门店提现申请记录
     *
     * @param id 门店提现申请记录主键
     * @return 门店提现申请记录
     */
    @Override
    public WithdrawApply selectWithdrawApplyById(Long id)
    {
        return withdrawApplyMapper.selectWithdrawApplyById(id);
    }

    /**
     * 查询门店提现申请记录列表
     *
     * @param withdrawApply 门店提现申请记录
     * @return 门店提现申请记录
     */
    @Override
    public List<WithdrawApply> selectWithdrawApplyList(WithdrawApply withdrawApply)
    {
        return withdrawApplyMapper.selectWithdrawApplyList(withdrawApply);
    }

    /**
     * 新增门店提现申请记录
     *
     * @param withdrawApply 门店提现申请记录
     * @return 结果
     */
    @Override
    public int insertWithdrawApply(WithdrawApply withdrawApply)
    {
        withdrawApply.setCreateTime(DateUtils.getNowDate());
        return withdrawApplyMapper.insertWithdrawApply(withdrawApply);
    }

    /**
     * 修改门店提现申请记录
     *
     * @param withdrawApply 门店提现申请记录
     * @return 结果
     */
    @Override
    public int updateWithdrawApply(WithdrawApply withdrawApply)
    {
        withdrawApply.setUpdateTime(DateUtils.getNowDate());
        return withdrawApplyMapper.updateWithdrawApply(withdrawApply);
    }

    /**
     * 批量删除门店提现申请记录
     *
     * @param ids 需要删除的门店提现申请记录主键
     * @return 结果
     */
    @Override
    public int deleteWithdrawApplyByIds(Long[] ids)
    {
        return withdrawApplyMapper.deleteWithdrawApplyByIds(ids);
    }


    /**
     * 批量逻辑删除门店提现申请记录
     *
     * @param ids 需要删除的门店提现申请记录主键
     * @return 结果
     */
    @Override
    public int logicDeleteWithdrawApply(Long[] ids,String delType,Long delUser)
    {
        return withdrawApplyMapper.logicDeleteWithdrawApply(ids,delType,delUser);
    }

    /**
     * 删除门店提现申请记录信息
     *
     * @param id 门店提现申请记录主键
     * @return 结果
     */
    @Override
    public int deleteWithdrawApplyById(Long id)
    {
        return withdrawApplyMapper.deleteWithdrawApplyById(id);
    }
}
